package zuoye3;
//3)、模拟三个老师同时分发30份笔试试卷，每个老师相当于一个线程。
public class Teacher implements Runnable{

    @Override
    public void run() {
        for (int i = 0; i < 30; i++) {
            System.out.println(Thread.currentThread().getName()+"正在发第"+(i+1)+"份试卷");
        }
    }
    public static void main(String[] args) {
        Teacher rb=new Teacher();
        Thread t1=new Thread(rb,"语文老师");
        Thread t2=new Thread(rb,"数学老师");
        Thread t3=new Thread(rb,"英语老师");
        t1.start();
        t2.start();
        t3.start();
    }
}
